package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * TODO
 *
 * @Author yml
 * @Date2025/5/17 22:15
 */
@Mapper
public interface DishFlavorMapper {
    /**
     * 批量插入多条口味数据
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);

    void deleteByDishIds(@Param("ids") List<Long> ids);

    /**
     * 根据菜品id查询口味
     * @param dishId
     * @return
     */
    @Select("select * from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> getByDishId(Long dishId);


    /**
     * 根据菜品id删除
     * @param id
     */
    void deleteByDishId(@Param("id") Long id);
}
